<template>
<div class="main">
  <!-- 头部导航栏 -->
  <head-component
    :noBack="false"
    :title="title"/>

  <div class="top">
    <!-- <div class="tit f32 col_33">{{txt.news_title}}</div> -->
    <!-- <div class="tit2 f26 col_66" style="margin-top:0.26rem">{{txt.news_addtime}}</div> -->
  </div>
  <div class="con f30 col_33" v-html="txt.news_content">

  </div>
</div>
</template>

<script>
import headComponent from '@/components/layout/head'
export default {
    name: "ganhuoD.vue",
    data() {
      return {
        txt:'',
        id:'',
        type:1,
        title: ''
      }
    },
  created(){
    var $this = this;
    $this.id = $this.$route.query.id;
    $this.type= $this.$route.query.type;
    $this.getCon($this.id);
    $this.title = $this.$route.query.title
  },
    methods:{
      getCon(id){
        var $this = this;
        var t = this.$toast.loading({message:'正在加载数据',mask:true, duration:9999})
        var data = {u_id: localStorage.getItem('uid'),token:localStorage.getItem('token'),news_id:id};
        $this.$axios.post('index.php?m=index&c=news_detail',data)
          .then((res) => {
            t.clear();
            if(res.data.code == 1){
              $this.txt = res.data.res;
            }else{
              $this.$toast({
                message: '请先登录',
                duration: 800,
                onClose:()=>{
                  $this.$router.push('/login');
                }
              })

            }
          })
      },
    },
    components: {
      headComponent,
    },
}
</script>

<style scoped  lang="less">
  .layout-head{border-bottom: 0.02rem solid #f5f5f5;}
  .top{width: 92%;
    margin: 0.8rem auto 0rem;padding: 0 0 0.4rem;}
  .con{
    width: 92%;
    margin: 0.5rem auto;
    overflow: hidden;
    line-height: 0.6rem;
  }
</style>
